package com.yumeko.dubbo.service.impl;

import com.yumeko.dubbo.config.RabbitmqConfig;
import com.yumeko.dubbo.pojo.User;
import com.yumeko.dubbo.service.PrividerMessageService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;

@Service(version = "${dubbo.version}")
public class PrividerMessageImpl implements PrividerMessageService {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Override
    public String consume(User user) {
       rabbitTemplate.convertAndSend(RabbitmqConfig.SPRING_BOOT_EXCHANGE,RabbitmqConfig.SPRING_BOOT_BIND_KEY,user);
       return "hello rabbitmq";
    }
}
